package ve.ejb.metadata;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author memozac
 */
@Entity
public class ColorimetryScheme implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long idColorimetryScheme;

    @OneToMany private Collection<ColorimetryStandard> colorimetryStandards;

    @OneToMany private Collection<Color> colors;

    @Column(columnDefinition="text") private String name;

    @Column(columnDefinition="text") private String description;

    @Temporal(value = TemporalType.TIMESTAMP) private Date registerDate;

    private Boolean active;

    public Date getRegisterDate() {
        return registerDate;
    }

    public void setRegisterDate(Date registerDate) {
        this.registerDate = registerDate;
    }

    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Collection<Color> getColors() {
        return colors;
    }

    public void setColors(Collection<Color> colors) {
        this.colors = colors;
    }

    public Collection<ColorimetryStandard> getColorimetryStandards() {
        return colorimetryStandards;
    }

    public void setColorimetryStandards(Collection<ColorimetryStandard> colorimetryStandards) {
        this.colorimetryStandards = colorimetryStandards;
    }

    public Long getIdColorimetryScheme() {
        return idColorimetryScheme;
    }

    public void setIdColorimetryScheme(Long idColorimetryScheme) {
        this.idColorimetryScheme = idColorimetryScheme;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idColorimetryScheme != null ? idColorimetryScheme.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof ColorimetryScheme)) {
            return false;
        }
        ColorimetryScheme other = (ColorimetryScheme) object;
        if ((this.idColorimetryScheme == null && other.idColorimetryScheme != null) || (this.idColorimetryScheme != null && !this.idColorimetryScheme.equals(other.idColorimetryScheme))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ve.ejb.entity.ColorimetryScheme[id=" + idColorimetryScheme + "]";
    }

}//ends of class
